<?php

namespace app\wempapi\model;

use think\Model;

/**
 * Inform
 */
class Inform extends Model
{
   
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;


    public function getImagesAttr($value): array
    {
        if ($value === '' || $value === null) return [];
        if (!is_array($value)) {
            $images =  explode(',', $value);
            foreach ($images as $k => $v) {
                $images[$k] = full_url().$v;
            }
            return $images;
        }
        return $value;
    }

    public function getImageAttr($value): string
    {
        return !$value ? full_url().'/static/images/xxcy1.png'  : full_url().$value;
    }

    public function getContentAttr($value): string
    {
        return !$value ? '' : htmlspecialchars_decode($value);
    }


}